<?php
namespace core\lib;
use core\lib\conf;
/*继承PDOstart------
class model extends \PDO{
	public function __construct(){
		$dsn = conf::get('DB_TYPE','database').":host=".conf::get('DB_HOST','database').";dbname=".
		conf::get('DB_NAME','database');
		$username = conf::get('DB_USER','database');
		$passwd = conf::get('DB_PWD','database');
		try{
			parent::__construct($dsn,$username,$passwd);
			parent::query("set character set 'utf8'");
		}catch(\PDOException $e){
			p($e->getMessage());
		}	
	}
}
--------继承PDOend*/
class model extends \Medoo\Medoo{
	public function __construct(){
		$option = array(
			  // 必须配置项
			'database_type' => conf::get('DB_TYPE','database'),
			'database_name' => conf::get('DB_NAME','database'),
			'server' => conf::get('DB_HOST','database'),
			'username' => conf::get('DB_USER','database'),
			'password' => conf::get('DB_PWD','database'),
			'charset' => 'utf8',
			'prefix'=>'tp_'
		);
		parent::__construct($option);
	}
}